/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.member;

import com.enation.app.javashop.client.member.DepositeClient;
import com.enation.app.javashop.core.client.fallback.member.DepositeClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import com.enation.app.javashop.model.member.dos.MemberWalletDO;
import com.enation.app.javashop.model.member.vo.MemberDepositeVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
*
* @description: 预存款客户端
* @author: liuyulei
* @create: 2019/12/30 18:40
* @version:1.0
* @since:7.1.5
**/
@FeignClient(name = "member-service", fallbackFactory = DepositeClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface DepositeClientFeignImpl extends DepositeClient {


    /**
     * 增加会员预存款余额
     * @param money 金额
     * @param memberId 会员id
     * @param detail   操作描述
     * @return
     */
    @Override
    @RequestMapping(value = "/client/members/{member_id}/deposite/increase", method = RequestMethod.POST)
    Boolean increase(@RequestParam("money") Double money, @PathVariable("member_id")Long memberId, @RequestParam("detail") String detail);

    /**
     * 扣减会员预存款余额
     * @param money 金额
     * @param memberId 会员id
     * @param detail   操作描述
     * @return
     */
    @Override
    @RequestMapping(value = "/client/members/{member_id}/deposite/reduce", method = RequestMethod.POST)
    Boolean	reduce(@RequestParam("money") Double money, @PathVariable("member_id")Long memberId, @RequestParam("detail") String detail);

    /**
     * 获取会员钱包信息
     * @param memberId
     * @return
     */
    @Override
    @RequestMapping(value = "/client/members/{member_id}/member-wallet", method = RequestMethod.GET)
    MemberWalletDO getModel(@PathVariable("member_id")Long memberId);


    /**
     * 添加会员钱包信息
     * @param walletDO
     * @return
     */
    @Override
    @RequestMapping(value = "/client/members/member-wallet", method = RequestMethod.POST)
    MemberWalletDO add(@RequestBody MemberWalletDO walletDO);

    /**
     * 校验支付密码
     * @param memberId  会员id
     * @param password  支付密码
     * @return
     */
    @Override
    @RequestMapping(value = "/client/members/{member_id}/member-wallet/check-pwd", method = RequestMethod.GET)
    void checkPwd(@PathVariable("member_id")Long memberId, @RequestParam("password") String password);


    /**
     * 获取预存款支付相关
     * @param memberId
     * @return
     */
    @Override
    @RequestMapping(value = "/client/members/{member_id}/deposite", method = RequestMethod.GET)
    MemberDepositeVO getDepositeVO(@PathVariable("member_id")Long memberId);
}
